<?php

class Model_Form_Login extends Model_Form
{
    public function init()
    {
        $this
            ->setAction('/auth/login')
            ->setMethod('post')
            ->setAttrib('id', 'authForm');

        $this->setDecorators(array(
                    'FormElements',
                    array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')),
                    array('Description', array('placement' => 'prepend')),
                    'Form'
                    ));

        $username = $this->createElement('text', 'username');
        $username
            ->setLabel('Username:')
            ->setRequired(true)
            ->setDecorators($this->elementDecorators)
            ->addFilter('StringToLower');

        $password = $this->createElement('password', 'password');
        $password
            ->setLabel('Password:')
            ->setRequired(true)
            ->setDecorators($this->elementDecorators)
            ->setRequired(true);

        $submit = $this->createElement('submit', 'submit');
        $submit->setDecorators($this->buttonDecorators);

        $this->addELements(array($username, $password, $submit));
    }
}
